<template>
    <el-row class="main-cont padd20">
        <el-row class="height100">
            <el-row class="mt20 padd20 maxwidth" :gutter="20" v-if="cous != null">
                <el-col class="tl" style="font-size: 18px;">
                     本校【劳动实践】课程协同教研成果一览
                </el-col>
                <el-col :span="12" class="list" v-for="(item,i) in ldsjlist" :key="i" @click.native="goSj(item)">
                    <div class="grid-content bg-white box box-align-center box-pack-start">
                        <div class="left box box-pack-start box-align-center">
                            <el-image :src="item.img" class="img"></el-image>
                        </div>
                        <div class="ml10 box box-tb box-pack-start" style="width: 100%;height: 96px;">
                            <div class="box box-pack-between box-align-start">
                                <h3>{{item.title}}</h3>
                                <span class="title" v-if="item.type == '0'">日常生活劳动</span>
                                <span class="title" v-if="item.type == '1'">生产劳动</span>
                                <span class="title" v-if="item.type == '2'">服务性劳动</span>
                            </div>
                            <div class="ldmb box box-pack-start box-align-start mt10">
                                <div class="tl" style="width: 80px;">劳动目标：</div>
                                <div class="ldmb-cont tl">{{item.ldmb}}</div>
                            </div>
                        </div>
                    </div>
                </el-col>
            </el-row>

            <el-row class="height100 box box-pack-center box-align-center" v-else>
                <el-empty description="暂无数据" image="../../../static/image/nodata/nodata.png"></el-empty>
            </el-row>
        </el-row>
    </el-row>
</template>

<script>
    export default {
        data() {
            return {
                loginInfo:this.$store.state.loginInfo,
                cous:null,
                ldsjlist:[],
                num: 0,
                schoolid:this.$store.state.schoolId,
            };
        },
        mounted() {
            this.getTrTask();
        },
        methods: {
            getTrTask() {
                let params = {
                    schoolid: this.schoolid,
                };
                this.$api.tr.getTrTask(params).then(res => {
                    if (res.code == '0') {
                    // console.log(res);
                        this.cous = res.cous;
                        this.ldsjlist = res.ldsjlist;
                        if(res.plan!=null){
                            this.num = res.plan.sjNum;
                        }
                    } else {
                        this.$message.error('请求失败！');
                    }
                })
            },
            selectXnxq(e) {
                this.xnxq = e;
                this.getTeachPlanInfo();
            },
            goCourse(item) {
                this.$router.push({
                    path:"/jxrw/kcxq_tr",
                    query:{
                        id:item
                    }
                })
            },
            goSj(item) {
                this.$router.push({
                    path:"/jxrw/sjxq_tr",
                    query:{
                        id:item.id
                    }
                })
            },
        }
    }
</script>

<style scoped lang="scss">
    .el-table .warning-row {
        background: oldlace;
    }

    .el-table .success-row {
        background: #f0f9eb;
    }

    .maxwidth {
        max-width: 1400px;
        // margin: 20px auto !important;
        margin-left: 120px !important;
    }

    .tab {
        width: 158px;
        height: 42px;
        line-height: 42px;
        border-radius: 14px;
        border: 1px solid #E5E6F1;
        background-color: #fff;
        font-size: 18px;

        &:first-child {
            border-radius: 14px 0px 0px 14px;
        }

        &:last-child {
            border-radius: 0px 14px 14px 0px;
            border-left: none;
        }

        &.active {
            background: #626BF1;
            color: #fff;
        }
    }

    .grid-content {
        padding: 0 10px;
        margin-top: 20px;
        height: 134px;
        background: #FFFFFF;
        border: 1px solid #fff;
        border-radius: 12px;
        transition: .3s ease-in-out;

        .el-plus {
            display: inline-block;
            width: 32px;
            height: 32px;
            line-height: 26px;
            background: linear-gradient(-13deg, #626BF1, #989BFA);
            border-radius: 16px;
            color: #fff;
            font-size: 26px;
            font-style: normal;
        }

        .img {
            width: 148px;
            height: 96px;
            border-radius: 12px;
        }

        .right {
            height: 96px;

            .title {
                width: 134px;
                height: 20px;
                background: #F3F4FB;
                border-radius: 9px;
                color: #939FF4;
                font-size: 14px;
            }

            .delete {
                width: 46px;
                height: 24px;
                background: #FFFFFF;
                border: 1px solid #FF5A77;
                border-radius: 12px;
                color: #FF5A77;
            }
        }

        &:hover {
            border: 1px solid #BEBDE6;
            box-shadow: 2px 6px 13px 0px rgba(225, 227, 245, 0.69);
        }
    }
    h3 {
        font-size: 24px;
        overflow: hidden;
        text-overflow:ellipsis;
        white-space: nowrap;
    }

    .title {
        margin-top: -10px;
        width: 134px;
        height: 20px;
        background: #F3F4FB;
        border-radius: 9px;
        color: #939FF4;
        font-size: 14px;
    }

    .bg-white {
        background-color: #F8F9FC;
    }

    .item {
        margin-top: 50px;
        width: 334px;
        height: 20px;
        background: #F9E0DE;
        border-radius: 10px;

        span {
            color: #E36572;

            i {
                margin-right: 10px;
                display: inline-block;
                width: 48px;
                height: 20px;
                line-height: 20px;
                background: #EE8892;
                border-radius: 3px;
                text-align: center;
                color: #fff;
                font-style: normal;
            }

        }


    }
    .ldmb{
        font-size: 13px;
        color: #B8BDCA;
    }
    .ldmb-cont {
        width: calc(100% - 80px);
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;

    }
</style>
